@page "/Stacked_Area_Chart"
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<AntDesign.Charts.Area Config="config1" OtherConfig="otherConfig" OnFirstRender="onChart1_FirstRender" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <AntDesign.Charts.Area @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }


    #region 示例1

    private async Task onChart1_FirstRender(IChartComponent chart)
    {
        var data1 = await DemoData.OilAsync(NavigationManager, HttpClient);
        await chart.ChangeData(data1);
    }

    AreaConfig config1 = new AreaConfig()
    {
        XField = "date",
        YField = "value",
        SeriesField = "country",
        Color = new string[] { "#6897a7", "#8bc0d6", "#60d7a7", "#dedede", "#fedca9", "#fab36f", "#d96d6f" },
        Legend = new Legend()
        {
            Visible = true,
            Position = "right-top",
        }
    };


    object otherConfig = new
    {
        xAxis = new
        {
            range = new object[] { 0, 1 },
        },
    };

    #endregion 示例1

}



